fixed memory leak issue on mouse simulation program