Is this check necessary? Maybe remove it or replace with assert?