fixed bug in determining active profiles