Fix the connection handler