Fixed deadlock in the client processing
Improved connection handling

Synchronized value submit with connection state, also improved logging.