js ordering fix