fix detection of the correct profiles