fix foreach else syntax