added authentication functionality