fix graph & link to database