check foreach