made true saving of the db possible, not so hacky now