make update.php more robust