add offline code