Setup expiry wait function.