fixed ugly bug in databasecontroller