added some logging & tests