add redirect and error page