added authentication checks