handle order, added some js code