kill processes properly