 got segmentation fault after detach the mouse, but it is not always;