Fixed problems with the DB when is there no data