fixed decode switching bug