Add hasOwnProperty check