Try to handle some exception
other changes
Add back in randomization