Fix renderFragment method