Fixed issue with database connection