added Repository#flush method