fixed javascript issue with mobile version of layout