get upper limit using .last on range