fixed some bugs with the avatar