Add faction checking function