trim trailing reset properly