now handling 404 and 500 errors using error templates