Work on catching error and add delay_while_idle flage