random seed overflow bug fix