Remade authentication to avoid denial of service