added stage defininf conditions