adds better logging