handle tab changed event