Modified string search to remove jslint complaint