fix indentation; improove logging