additional safe check in close_proc
Merge pull request #100 from Eloar/patch-2

additional safe check in close_proc