added depth search for type