fixed issue with script hanging if no space to randomize