Fixed js for mobile devices