fixed bug with random states generation
fixed bug with random states generation
merged 0.5.2