Fix problem with database access