use arc4random_uniform to fix 64 vs 32 bit bug.