add some logic to the hack to prevent shutdown while running
Merge pull request #35 from thiagohersan/molaa

add some logic to the hack to prevent shutdown while running