Set cursor after loop