Updates for checking before looping foreach