updates and better logging