updated form, fixed bugs