fixing order-by script