change cancel function to close

https://bugzilla.mozilla.org/show_bug.cgi?id=1101661