fixing cursor position