fixing javascript driver cursor cleanup