updated decoder to use protect