Added validation of formid