fixed bug with getting in-degree nodes