check function in decoder.py