Implement proper QP cancel

Fix error in os.makedirs