fix for rank check