Fix Potential Memory Leak Issue