guard against invalid numbers