fix decoder state