type and class check added to model