improving master keepalive check