modified in order to upload avatar