Code for mobile detection