Adding Authentication logic