Modified the Abort code to work better for multiple threads.