fix usage of $elem.val(undefined)