sometimes size changes, so malloc a new str and return it