revised the Media Query function