added code for avatar