database access bug fixed