Colocado o conteudo do infinite loop no dispatch.