heartbeat fix for shitty clients and more debug printing