Removed synchronized blocks.
Added reconnection support.
Added reconnection support.