Unregisters the old trigger and creates a new one for each iteration.