CLose connection only if is opened
Version changed