Added authentication hook