Fixed crash issue, memory leak not fixed