fix for live site where foreach was not working