move launching beaker to app delegate, add closing the task on app exist