fix secure random bug