authenticate method added