some ugly logging