implementado desligamento suave, resolves #19