another attemp to avoid string memory leak - use temporary string