makes function resume actually work