part 2 of fixing #5521