Fixed logic problem with killing process if it did not stop gracefully