trimString function added