Corrige problemas com lastSelected