fix scary bug that happens when there is no database in existance yet. closes #31