correct check for rank