fixed doMouseDown function