added re-submission logic again