added authentication check