refactor
If nil return value, use the form buffer instead

closes #887