added type check for 'Iterator'