Fixes popup closing issue

Fixes issue where popup wasn't closing when term was clicked a second
time.