Bug fix for searching valid entries
NPE