shutdown logic flow fix for both no password and password mode