fixed cancel button to show the proper butons when clicked