fix bug in trimdata
Merge pull request #508 from dimagi/ugh-fix

fix bug in trimdata