made changes to get top attributes of multiple templates instead of 1