fixed message order and fixed the start of the first loop