added take offline and bring online function