fixing trim error