Updated to better handle data and submition form