corrected a type check