fix scope for declare: add -g flag (see `help declare`)