added blink detector for main.py