Window.location.reload() instead of infinite loop