close cursor after execution