added some code to help make mobile work