fixed 'close' behaviour