small changes to retrieve.php