added sleep to shutdown

added sleep to shut down holding it off the scrip until the the flag
file is gone