Fixed exception on disconnect