fixed bug with reopen cursor