added heartbeat, removed more locks