working on one_shot flag