fixing sql type in updating graphs