fix select out of scope