fix trimming