added function for dom element compare