added some logic for the header for mobile