close cursor after execute sql