Fixing some JS ordering