Ive figured why the LED freezes now. After generating the random number i was using */ and storing the result back in the same variable. It looks like the RANDOM command uses whats already in the variable as a seed and as i was modifying the value to really low numbers, eventually it was hitting 0 and staying there. I added a second variable and its all working now