Add a conditional logic to submit button