Handle long running tasks (fixes #5)