Add logging
update element state