fixed bug related to searching nil values