added close method so it will play nice with Node-RED