corrected range argument validation