fixed bug in random mode of signal generator