fixing name assembling based on tags