Fixed a bug when trying to add a Document into a not existing Database