writes back data to form