add offline function