Implemented off() function to take in a mediaType parameter