another attempt at fixing profile switch problem