fixed databaseError bug