bug fix for error page and related functions