form post and some bug fixes