Added logging and keepalive