adds check that rank is nil