created functions to force onlien and offline