Make modifications to 404 & 500 logic