Added checkMobile function