fix scope from global to local