replace testing for undefined to the testing for null or undefined to prevent warning of usage cm.searchtype below