Code cleanup
Fixed crash when searching without internet connection