fixing database error