fixed missing function when uploading avatar