debugging code to see typeof element