In this paper we present a modified hierarchical agglomerative clustering algorithm for building tag ontologies for social tagging systems. The modified algorithm first uses a clustering algorithm called Domain Similarity Clustering By Committee (DSCBC) (Tomuro et al. 2007) to derive a set of tag committees. We apply DSCBC to the tags entered by the users of social tagging systems and derive (un-ambiguous) committees of tags. Using the committees, a tag ontology is constructed in which an ambiguous tag is separated into multiple, disambiguated tags/nodes. Then a tag profile of a given user is matched against the ontology, and an ontological profile of the user is created. Finally a preference vector is fed into the (modified) FolkRank algorithm (Hotho et al. 2006a), and the web resources ordered based on the user's preferences are returned. We run our system on the data from two social tagging systems and compare the results with other algorithms. The results showed our algorithm achieved marked improvements over other algorithms.