fixed wait func