add function to update device