Add encode option, cannot be none