add closeApp handler