add trim to S