Quick fix: out of bound error when select term on main window,
added if statement to catch