Function waitValue