now use bash isntead of sh; added start and exit events