check if $forms empty before foreach