added abort function