updated patchdb.php