Close() method for closing connection