Adding hasOwnProperty check to stop lookup on the prototype