Avoid memory leak by removing 'mouseup' handler