added an exit app function to the root scope