fixed invocation of methods with no params
fixed connection state
added lock for connection state and heartbeat monitor