fix trim error