added write_end.php