Fixed the random wait time generation. Before, it was always 1 second and sometimes stopped working.