part 3 of fixing #5521