updated heartbeat method