created a function which contains the check of affectors