fix rotation bug, some global js, etc