update using recursive