fixes getSelected method returning selected + 1 when select all is checked

Sorry, i forgot one commit for fixing select all.