Update the reason text file
Fix potential memory leak when reusing an existing variable