bug fix in select