Added global flag setting and branching for dialogue system