Added offline logic.