Cursor and db closing fix