Added 10s loop and signal handler