Better event handler validation