comparator resets to undefined