Added some security to avoid shutdown from external apps.