Fix Javascript error on mobile version of website