opening and closing relays