added hasOwnProperty check to avoid warnings