prevent indexing error in tab before selected handler