Fix mouse tracking bug