add better logging and requiring