Fixed removeFragment method