added min and max wait time