fix scope for global