format and modify run and prepare cursor