isSubmitted function