add hackish logging hook