add srand for rand