fix crashed when process has been killed