Change hasOwnproperty to an in check