fixed cursor crash bug