added abort function and destroy