encode return fix