Added additional error handling during parallel and thread based operations that could cause the application to crash if not handled properly.