improving error page redirection