Fixed usage after free