better way to reset cursor position