Update submit.py

insert wait function