add function.php and clean temp files