fixed the select bug