fix for terminating process