implementation of cancel activity