Fixed problem with database connection