made overflow-safe