add save method to repo