Added additional check for initialization