improved logging and deduced a large flaw in the DB storage process