added a 'ready' event to initialize the client. this fixed some out-of-sync stuff that was happening with connect and disconnect