fix problem for empty database