Fixing database issue