Added authentication check