Fix for duplicating graph bug