make error page take messages and move try except