Fixed problem with cleanup operation on ctrl+c