script for fixing the database