fixed bug in update avatar