added isValid function to the TaskHandle
added assert to the EventManager