fix select code bug