Fixed loop logic in postall parent script