Added support to indetify if user have selected cancel, rename certain function