Corrected the authenticate method for day2 problems