bug fix and form check