explicitly close cursors when relations exist