add cancle and close function