fix flags of main agent