Fixed test problem when the mongodb is empty