write_scope_attribute ignores empty values