fix graph bugs