added double check on power off