modify some code for mobile