modification in task to filter events