Add missing call to .ref() before calling .update()