Added pause on leaving application