kill command can fail when the process has terminated after the ps command