correct a syntax mistake when using hasOwnProperty