fix the trim call must be before the regex replace