fix bug for 'none' encoding