close cursor after use