site: Replace wait_timeout variable with function