after_write infinite loop?
a fix for after_write infinite loop. could be costly though
cleanup old code
adds headers back
writes should be on the response instance