fix bugs in UIEvent