fix choose algrithom bug