fix cursor position