Implemented callback and handling of multiple calls on connect()