fix trim problem