if the error is show in the html it should be logged
fix race conditions by delaying the assingment to the "proper" variable