fix trim() problems