prevent js error when the avatar input is empty