Fixed - invalid argument for foreach