submit flag and open/close task