use assert for getinitflag