handle null globalSearchTerm correctly