add better logging