refactor error page