fixing database problems