add timeout on forever loop