fixed process shutdown to work with windows