Fixed quit program button and add delay to the communcation

with linkam to try and solve the controller getting stuck.