changing body of authenticate method