fix bug caused on linux by srand warning fix