Fix authentication failing sometimes