Updated the deadman function to publish from the gui