fixed the database issue