removed console log
messy code but everything seems to work. Fixed avatar issue