update the code for handle mousemove event