adding offline functionality