Implemented close method on connection.