fixing bug with mouse positioning