fix crash in mouse messages while quitting