add function for updating