fixed bug with database access and black screen