daemonise thread so gateway can be safely killed