add update method to repository class