[#223] Check connection status

* Minor code formatting