Fixed undelegare events and added cancel button