update code to work in mobile