IE8 compatibility

@rjrodger I added hasOwnProperty check here