fixed a trim bug