Added logging to toggleRelay