     //power off camera
     buf[0] = 3; buf[1] = 'P'; buf[2] = 'W'; buf[3] = 0x00;
     SendBufToCamera();
-
-    //detach Mewpro
-    pinMode(BPRDY, INPUT);
-    delay(500);
+    tdDone = false;
+
+    //wait for some time
+    delay(5000);
 
     //power on camera
     pinMode(PWRBTN, OUTPUT);

          }
        }
        return;

//*************************End of custom commands***********************************


    delay(1000);
    tdDone = false;     //maybe comment this later
    pinMode(PWRBTN, INPUT);
    
    //detach Mewpro
    pinMode(BPRDY, INPUT);
    delay(1000);

//DO NOT UNCOMMENT codes below (not tested yet)
/*
