Added in offline functionality