Fix for heartbeat.stop() attribute error issue