bug fixes in select