Fixed undefined issue when mouse moves