fixing saving in DB