fixed rm bug