automatically display modal if form has errors