optimizing quit action

i have just took a look on the quit action, i think this would be much easier.
Merge pull request #10 from anasAsh/patch-1

optimizing quit action