working on fixing the database