Added changes to save form data to database.