handle online and offline actions