output db write bugfix