made random id work with ranges