fix infinity cycle in PHPEvent