Fixed double free issue

Fixed double free issue