adding better logging