CHANGED:applied the cancel/done button action