fixed the wait_until_cursor_at method