Add abort flag in all functions