Fixing bug that causes @endforeach to break.