Resolve cursor close exception
Merge pull request #104 from barterli/crash/#61

Resolve cursor close exception