fixed a bug with getting mouse position