JS random function now is working