added the ability to control the relay