bug fixes for selecting