Good catch. I introduced this logic in the caller, no reason not to have it here too just in case