added pertag functionality
added pertag functionality patch