fixed a file descriptor leak
implemented saving for node addresses