implemented avatar callback function