fix bugs for cursor missing.