Fix the problem when the lifecycle event can be triggered more then once incorrectly