Issue #2: form reference bug fix