Added tab changing functionality