fixed bug regarding graph dimension