renamed function 'WaitEventFiltered' to 'WaitValidEvent'