added delay option, time interval was hard-coded to 1s before