javascript fix attempt for mobile