changed functions so it works with the client server. Added ob_start() and ob_end_flush and deleted whitespaces in functions.php.