Added try catch around disconnect