added authentication detection