Fixing fatal error in database connection