fix setting cursor position with up/down