Fixed fragment creation logic