added validEvents method.