Updated the scripts with the latest changes to delete record