update output method add output to  db and file