(bug) Able to send commands after reconnect

Also, added a lot of logs for debugging. Keeping these logs
because they proved useful. However some details are
still missing. I could not figure out how to output the IP
or some other session identifier. Should also add timestamp