-change invade rule for mode2. merge some functions