changed type check from iterator to traversable