Added isSubmitted check