fix bug with redirect to errors