internal check for rangeness