fix some bug in main.py