saving changes for db