Adding debugging logging