refactored to use a promise on saving