fix encoder