2 side hysteresis + more try catch in main.py