Attempting to fix the database code