Fixing randomness error

Was not correctly generating random parameter. This would work on a website that was reloaded everytime, but not a script that was loaded once. Fixed it by calling a method for first random var