fixes bug when switching profile