There are many callbacks inside appendAll function,due to which sometimes transition from Gallery application to MMS composer screen is very slow because of which if user press again share button there can be a crash. To avoid the crash and delay we added the setTimeout function.