added mobile detection middleware