fix runtime error if form input has no ancestor form