added cancel by clicking outside the popup