fix random assign bug