fixing bug when there are multiple form items