Fixed crashing because of number generation