Added termination logic, added cancel method to promises