fix sytnax on foreach loop and if