tidy up and lint
use the ready event rather than connect to ensure that we can send commands immediately