dont encode the body if its nil