make sure cursors are closed after block exit