fix bug in mouse tracking