fixed bug in best peak selecton