close cursor after using it