fix media query bug. Fixes #1502