Corrected error when search returned nil instead of empty