fix error state redirecting