updated form handler