added ability to specify a writercloser for the results