implements action for submit button