checking class beforing firing events