finish custom error page and test code