The hot and cold pipes have been connected the wrong way around; this means that when the thermostat tries to cool things down it's actually adding more hot water instead, and vice versa. Either swap the pipes, or get a reverse thermostat cartridge.
Tom
December 2014