update using core data