added toggle for hearbeat to save cpu cycles