Make sure that mediaQuery.addListener is defined before calling it