fix bug: avoid crash relate to mouse action