added docstring, minor fixes
handling exceptions (disconnected, failed job)