fixed caching to happen on end, not body in case 404