update logic for delay