solve instead using a global waitTime