Stop heartbeat on close

Close #1