fixed bug for getting successors