Removed empty line
Split check/reconnect logic into two separate threads
Get rid of unneeded code in stall transaction check thread.