Allow to detect the first and last iteration