Automatic control of the temperature in phase change problems with memory