Added newlines, added check if pid exists