Call task only when the last event is triggered in folder. Refactoring.