fix the cancel button (bug 837979 and bug 837913)