Implemented 'close' command