Added constructor with form argument and fixed encoding issues of form values