[fix] properly handle a single callback as an argument to the connect function