Fixed authenticate method