Added a close function so we can stop the client for good.