added 'close' method