fix write neighbour bug