fix dashboard fails with empty database
added logic if database is empty