fixed loading and saving db (order was wrong)