Use Shared var instead of file for heartbeat (Thanks to Philippe S.)