decode bug fix