added authenticate method