Properly closed cursor