update function working...finally