fix source free bug