Added the interval to check the online status and the method to save when offline