fixing select bug