fix serialization and bidirectional link issues