Removed needless lines from MainActivity and moved exception handling to background thread's run body.