error and page flow