better range checks