controlling 5v relay with iviewer

i am trying to open my garage through iviewer 4 on adroid, using an arduino shield and a relay.
when i send the string from iviewer to the arduino it works but after the pulse it doesn’t stop. the relay keeps pulsing for a while in a loop. i wanted to send just one pulse.

i’d be glad if somebody could help me.

#include <SPI.h>
#include <Ethernet.h>

//---- MAC----------
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
IPAddress ip(192, 168, 0, 25);
//-----  PORTA (80)------
EthernetServer server(80);

//---RELAY (OUTPUTS)--------

int modRele1S1 = 8;

void setup() {
  // Open serial communications and wait for port to open:
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  //---start das saidas
  pinMode(modRele1S1, OUTPUT);

void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("novo cliente");
    // an http request ends with a blank line
    String vars;
    //--var -----------------
    int varmodRele1S1 = 0;
    while (client.connected()) {
      if (client.available()) {
        char c =;
        //------ command fusion -------------------------
        if (vars.endsWith("/modRele1S1onoff")) varmodRele1S1 = 1; //----garage door------
          if(varmodRele1S1 == 1)
            digitalWrite(modRele1S1,LOW); // pulse
            digitalWrite(modRele1S1,HIGH); // pulse