Added offline functionality