implemented better device media queries using JS