Don't crash in offline mode; rewrote search routine