check for invalid ranges