add database functionality to form submit