Fixed problems with the refresh of the DB