remade authenticate