Self online bug fixed. Code to trigger offline is also added.