adding limit to parallelism, made the flag an int
fixed hook issues with parallelism, made sure 'after' hooks are always called regardless of failure