add range check
fix conflict