added phase check