added profile tab selection logic