reorder js commands