Added option to disable encoding once enabled