removing 'close' listener properly
Merge #660 r=@jiahuang: removing 'close' listener properly