The problem here was, that the presence's 'to' attribute was overridden on each iteration, making the if statement fail after the first iteration.