Added exception handling to process kill