bugfix for db