fix setting avatar bugs