Fix bugs on mobile detection

Fix bugs on mobile detection