fixed encode model