cancel button properly implemented