Added offline handling