edit foreach error