some string allocation and deallocation to avoid memory leaks