change input check to hasOwnProperty('value')