fixed the subresource handling
added the pretty print bit so I can actually remember it later