closing cursors after use