added function to "submit" button