fix raise 'cursor closed'