modify the offline function