add safeguards for #3752