added code to set offline