fix random generator bug. fix duration stats bug