BUG: variables undefined in decoder