added redirecting of errors to the browser