encode.php modified