reworked patch as per https://bugzilla.mozilla.org/show_bug.cgi?id=1038992#c12