fixed a bug that appears if db is empty