Added forEach function to a wait component