The stopListening function was being passed the close event as an argument, which caused it to throw. // FREEBIE