fix _check_scope_level