Corrected bug with the timeouts, can now be used more than once!