close method for connection (#5)