fix cursor pos error