bug fix in select condition.