Fix logic of mobile detect