fix double headers send on 404
Merge pull request #268 from matiu/bug/404

fix double headers send on 404