modfied download.php as required