managing cancel button