returns -1 for selected row even when selected