bug fixes, selection works