correct "while(true)" in cursor event, but it is not final version