Fixes problem where NPE was thrown when item was clicked.