try to improve state handling in decoding threads