changed 'flush' to 'save'