make wait time be caculated dynamicly