fix: global cps to local var