fix cleaning up the processes