Added avatar logic