better logging
adding failure statistics