add force_return argument to Document loop