Add debug lines to keepalive logic