add missing endResource() writing Content