changed 'hasOwnProperty' to 'in'