Now all the cursors are closed after using.