first step to wait-for-resume function