Added Authentication logic