Fixed new user login error (caused by setting headers asynchronously)