bug fix on decoder