added update funciton