Fixed a bug in adjacency list