Fixed database connection issue