Fix database connection issue