function upadate implemented