bug: fixed foreach case issue