adding exception with empty database handling