add GLOBALS special var
remove unused state swap with mirror process