improve error check + add initMaster step for first run