Adjust code in protocal.py