beginning of goal detection