leafupdate func bug removed