Solve double free exception