bugfix for undefined database