make dataOnly available in encode