added cancel button functionality